<?php
/**
 * Created by PhpStorm
 * User: Jhinwy
 * Date: 5/29/24
 * Time: 10:14 AM
 */

namespace App\Models;

class WechatAccount extends BaseModel
{
    protected $table = 'wechat_account';

    protected $fillable = [
        'id', 'corp_id', 'department_id', 'user_id', 'user_name'
    ];


    /**
     * 所属部门
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function department()
    {
        return $this->hasOne(WechatDepartment::class, 'department_id', 'department_id');
    }


    public function userCategory()
    {
        return $this->belongsTo(WechatAccountCategory::class, 'user_id', 'user_id');
    }
}

